using Microsoft.AspNetCore.Mvc;
using JGSY.CMS.LowCode.Platform.Application.Interfaces;

namespace JGSY.CMS.LowCode.Platform.Controllers
{
    /// <summary>
    /// 系统管理接口。
    /// 提供系统信息查询、系统设置、健康检查等相关功能的 API。
    /// </summary>
    [ApiController]
    [Route("health")]
    public class SystemController : ControllerBase
    {
        /// <summary>
        /// 系统应用服务接口
        /// </summary>
        private readonly ISystemAppService _service;
        
        /// <summary>
        /// 构造函数，注入系统服务
        /// </summary>
        /// <param name="service">系统应用服务接口</param>
        public SystemController(ISystemAppService service)
        {
            _service = service;
        }

        /// <summary>
        /// 系统健康检查
        /// </summary>
        /// <returns>系统健康状态</returns>
        [HttpGet]
        public async Task<IActionResult> Health()
            => Ok(await _service.HealthAsync());
    }
}
